package com.ssr.master.common.utils;

import com.ssr.master.common.Base.PageBase;
import com.ssr.master.common.Base.PageBean;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZhangPeng
 * @Description //todo 接口返回工具类
 * @date
 * @updateBy
 * @other
 **/

public class ResultUtil {

    public static PageBase tablePage(int total, List<?> list,String erroeMsg) {
        return new PageBase(total, list,erroeMsg);
    }

    public static PageBase tablePage(PageBean info) {
        if (info == null) {
            return new PageBase(0, new ArrayList(),"");
        }
        return tablePage(info.getTotalNum(), info.getItems(),info.getErrorMsg());
    }
}
